﻿@{
    Layout = null;
    ViewBag.Title = "Home Page";
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台信息管理</title>
    <link href="~/Content/themes/default/easyui.css" rel="stylesheet" />
    <link href="~/Content/themes/icon.css" rel="stylesheet" />
    <script src="~/Content/jquery.min.js"></script>
    <script src="~/Content/jquery.easyui.min.js"></script>
</head>
<body>
    <div class="easyui-layout" style="width:100%;">
        <div data-options="region:'north'" style="height:50px;background-color:rgba(34, 177, 199, 0.21);">
            <div style="width:94%;padding-top: 14px;padding-left: 6px;">
                <span style="font-size:18px;">
                    欢迎使用数据信息管理
                </span>

                <a href="#" style="float:right" class="easyui-linkbutton" data-options="plain:true" onclick="javascript:loginOut()">退出</a>
                <label style="float:right;padding-top: 5px;padding-right: 0px;font-size: 12px;">欢迎你：admin |</label>
            </div>
        </div>
        <div data-options="region:'south',split:true" style="height:4 0px;">@*技术支持：北京筒子楼创意工作室*@</div>
        <div data-options="region:'west',split:true,title:'菜单'" style="width:150px;">

            <div class="easyui-panel" data-options="split:true" style="height:100%; width:100%">
                <ul class="easyui-tree" id="tree">
                    <li data-options="state:closed">
                        <span>信息管理</span>
                        <ul>
                            <li>
                                <span><a onclick="addTab('/admin/category', '种类管理')">种类管理</a></span>
                            </li>
                            <li>
                                <span><a onclick="addTab('/admin/news', '新闻管理')">新闻管理</a></span>
                            </li>
                            <li>
                                <span><a onclick="addTab('/admin/DataConfig', '配置信息')">配置信息</a></span>
                            </li>
                        </ul>
                    </li>

                    <li>
                        <span>教育培训</span>
                        <ul>
                            <li>
                                <span><a onclick="addTab('', '雅思培训')">雅思培训</a></span>
                            </li>
                            <li>
                                <span><a onclick="addTab('', '职业')">职业</a></span>
                            </li>

                        </ul>
                    </li>

                    <li>
                        <span>下载管理</span>
                        <ul>
                            <li>
                                <span><a onclick="addTab('/admin/UserFile', '文件下载')">文件下载</a></span>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
        <div data-options="region:'center',iconCls:'icon-ok'">
            <div class="easyui-tabs" id="tab" style="width:100%;height:100%">
                <div title="首页" style="padding:10px">
                    <p>Welcome!</p>
                </div>
            </div>
        </div>
    </div>

    <script>

        $(document).ready(function () {
            var height1 = $(window).height() - 20;
            $(".easyui-layout").attr("style", "width:100%;height:" + height1 + "px");
            $(".easyui-layout").layout("resize", {
                width: "100%",
                height: height1 + "px"
            });
        });


        $(window).resize(function () {
            var height1 = $(window).height() - 30;
            $(".easyui-layout").attr("style", "width:100%;height:" + height1 + "px");
            $(".easyui-layout").layout("resize", {
                width: "100%",
                height: height1 + "px"
            });
        });

        function addTab(url, title) {

            var isexists = $('#tab').tabs('exists', title);
            if (isexists) {
                $("#tab").tabs('select', title);
                //refreshTab(title, url)
            } else {

                $('#tab').tabs('add', {
                    title: title,
                    href: url,
                    closable: true,
                    tools: [{
                        iconCls: 'icon-mini-refresh',
                        handler: function () {
                            refreshTab(title, url);
                        }
                    }]
                })
            }
        }

        function refreshTab(title, url) {
            var tab = $('#tab').tabs('getTab', title);
            tab.panel('refresh', url);
        }

        function topCenter(title, msg) {
            $.messager.show({
                title: title,
                msg: msg,
                showType: 'slide',
                timeout: 2000,
                style: {
                    right: '',
                    top: document.body.scrollTop + document.documentElement.scrollTop,
                    bottom: ''
                }
            });
        }

        //公共方法 时间格式转换
        function formatTime(value, rowData, rowIndex) {

            if (value == undefined) {
                return "";
            }
            if (value.length == 0) return "";

            var d = eval('new ' + value.substr(1, value.length - 2));
            var ar_date = [d.getFullYear(), d.getMonth() + 1, d.getDate()];
            for (var i = 0; i < ar_date.length; i++) ar_date[i] = dFormat(ar_date[i]);
            return ar_date.join("-");

            function dFormat(i) { return i < 10 ? "0" + i.toString() : i; }
        }
        function loginOut() {
            window.location.href = "/AdminLogin/LoginOut";
        }
    </script>
</body>
</html>
